﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using LP580.CG;

public partial class Gift : System.Web.UI.Page
{
    protected int uid = Utils.RQ_int("u");
    protected string title = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int id = Utils.RQ_int("id");
            if (id == 0) id = 12;
            clsGiftProduct cls = new clsGiftProduct(id);
            cls.GiftProductHit();
            if (uid == 0) uid = cls.UserID;
            UserInfo1.uid = UserClass1.uid = uid;
            
            StringBuilder sb = new StringBuilder();
            sb.Append("<table width='770' border='0' cellpadding='0' cellspacing='0' class='mtop10'><tr>");
            sb.AppendFormat("<td width='426' valign='top'><img src='{0}' width='420' height='420' class='proshowimg'></td>", cls.GiftProductPic);
            sb.Append("<td width='344' align='right' valign='top'><table width='95%' border='0' cellspacing='0' cellpadding='0'><tr>");
            sb.AppendFormat("<td align='left' class='proline'>{0}</td>",cls.GiftProductName);
            sb.Append("</tr><tr>");
            sb.AppendFormat("<td height='26' align='left'>采购价：<span class='dianmp_date'>{0}/{1}</span></td>", clsGiftProductPriceSpan.GetName(cls.GiftProductPriceSpanID), cls.GiftProductUnit);
            sb.Append("</tr><tr>");
            sb.AppendFormat("<td height='26' align='left'>商品材质：<span class='prohuitext'>{0}</span></td>", cls.GiftProductMaterial);
            sb.Append("</tr><tr>");
            sb.AppendFormat("<td height='26' align='left'>商品包装：<span class='prohuitext'>{0}</span></td>", cls.GiftProductPacking);
            sb.Append("</tr><tr>");
            sb.AppendFormat("<td height='26' align='left'>产品尺寸：<span class='prohuitext'>{0}</span></td>", cls.GiftProductSize);
            sb.Append("</tr><tr>");
            sb.AppendFormat("<td height='26' align='left'>最小起订量：<span class='dianmp_date'>{0}{1}</span></td>", cls.GiftProductMinOrder, cls.GiftProductUnit);
            sb.Append("</tr><tr>");
            sb.AppendFormat("<td height='26' align='left'>装箱数量：<span class='prohuitext'>{0}{1}</span></td>", cls.PackingNum, cls.GiftProductUnit);
            sb.Append("</tr><tr>");
            sb.AppendFormat("<td height='26' align='left'>出货时间：<span class='prohuitext'>{0}天</span></td>",cls.GiftProductOuterTime);
            sb.Append("</tr><tr>");
            sb.AppendFormat("<td align='left' class='proline'><a href='javascript:addFav(\"g\",{0})'><img src='/images/jrsc.gif' width='108' height='61'></a></td>", cls.GiftProductID);
            sb.Append("</tr><tr>");
            sb.Append("<td height='40' align='left' valign='middle'><table width='50%' border='0' cellspacing='0' cellpadding='0'><tr>");
            sb.AppendFormat("<td align='left'>浏览量：</td><td align='left' class='datetext'>{0}</td>", cls.GiftProductHits);
            sb.AppendFormat("<td align='left'>收藏：</td><td align='left' class='datetext'>{0}</td>", cls.GiftProductFavorites);
            sb.Append("</tr></table></td></tr><tr>");
            sb.Append("<td align='left'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>");
            foreach (string pic in cls.GiftProductPics)
            {
                if (pic.Length != 0)
                {
                    sb.AppendFormat("<td><a href='#'><img src='{0}' width='93' height='93'border='0' class='border1' /></a></td>", pic);
                }
            }
            sb.Append("</tr></table></td></tr></table></td></tr></table>");
            sb.Append("<table width='770' border='0' cellpadding='0' cellspacing='0' class='mtop10'><tr>");
            sb.AppendFormat(@"<td class='dianmp_title1'><table width='100%' border='0' cellspacing='0' cellpadding='0'>
              <tr>
                <td width='80' align='center' >礼品详情</td>
                <td width='690' align='right'  class='dianmp_protj'>&nbsp;</td>
              </tr>
          </table></td>
        </tr>
      </table>
      <table width='770' border='0' cellpadding='0' cellspacing='0' class='mtop10'>
        <tr>
          <td class='proshowtext'>{0}</td>
        </tr>
      </table>", cls.GiftProductInfo);
            Litcon.Text = sb.ToString();
            title = cls.GiftProductName;
        }
    }
}